﻿using System.Security.Principal;

namespace N2.Commerce
{
	using Definitions;
	using Items;
	using Persistence;
	using Persistence.Finder;
	using Web;
	
	public class CartService
	{
		#region Fields
		//external references
		readonly IDefinitionManager definitions;
		readonly IItemFinder finder;
		readonly IPersister persister;
		readonly IHost host;
		#endregion Fields

		#region ctor

		public CartService(
			IDefinitionManager definitions,
			IItemFinder finder,
			IPersister persister,
			IHost host)
		{
			this.definitions = definitions;
			this.finder = finder;
			this.persister = persister;
			this.host = host;
		}

		#endregion ctor

		#region API

		public ICart GetCart(IPrincipal user)
		{
			return null;
		}

		#endregion API

		#region Properties

		ContentItem Root {
			get { return this.persister.Get(this.host.CurrentSite.RootItemID); }
		}
		
		#endregion Properties
	}
}
